package com.fy.controller;

import com.fy.dao.Fy_infoMapper;
import com.fy.entity.Fy_info;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/fyinfo")
public class Fy_infoController {
    String id ="1";
    @Resource
    Fy_infoMapper fy_infoMapper;
    @GetMapping("/getAll")
    public List<Fy_info> fy_infoMapper(){
        return fy_infoMapper.findAll();
    }
    @PostMapping("/insert")
    public String insert(String fy_name,String fy_id,String fy_eassy,String fy_pic,String cr_info,String fy_type,String fy_intro,String fm){
        fy_infoMapper.insert_fy_info(fy_name,id,fy_eassy,fy_pic,cr_info,fy_type,fy_intro,fm);
        id=(Integer.valueOf(id)+1+"");
        return "200";
    }
}
